/*
 * This file is part of TradeHelper library.
 *
 * TradeHelper library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * TradeHelper library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with TradeHelper library.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.rag.core;

import com.rag.utils.RagUtils;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

import javax.swing.*;
import java.io.Serializable;
import java.util.List;

/**
 * User: mgarin Date: 04.04.12 Time: 16:32
 */

@XStreamAlias( "Item" )
public class Item implements Serializable
{
    @XStreamAsAttribute
    private String id;

    @XStreamAsAttribute
    private ItemType itemType;

    @XStreamAsAttribute
    private ItemClass itemClass;

    @XStreamAsAttribute
    private DropType dropType;

    @XStreamAsAttribute
    private String title;

    @XStreamAsAttribute
    private String synonym;

    @XStreamAsAttribute
    private String cardSuffix;

    @XStreamAsAttribute
    private String description;

    @XStreamAsAttribute
    private String rmsDescription;

    @XStreamAsAttribute
    private String iroDescription;

    @XStreamAsAttribute
    private String motrDescription;

    @XStreamAsAttribute
    private String script;

    @XStreamAsAttribute
    private Integer slotCount;

    @XStreamAsAttribute
    private Integer buyPrice;

    @XStreamAsAttribute
    private Integer sellPrice;

    @XStreamAsAttribute
    private Float weight;

    @XStreamAsAttribute
    private Integer attack;

    @XStreamAsAttribute
    private Integer defense;

    @XStreamAsAttribute
    private Integer requiredLvl;

    @XStreamAsAttribute
    private Integer weaponLvl;

    @XStreamAsAttribute
    private Integer range;

    @XStreamImplicit
    private List<MobDrop> dropRates;

    public Item ()
    {
        super ();
    }

    public Item ( String id )
    {
        super ();
        setId ( id );
    }

    public String getId ()
    {
        return id;
    }

    public void setId ( String id )
    {
        this.id = id;
    }

    public ItemType getItemType ()
    {
        return itemType;
    }

    public void setItemType ( ItemType itemType )
    {
        this.itemType = itemType;
    }

    public ItemClass getItemClass ()
    {
        return itemClass;
    }

    public void setItemClass ( ItemClass itemClass )
    {
        this.itemClass = itemClass;
    }

    public DropType getDropType ()
    {
        return dropType;
    }

    public void setDropType ( DropType dropType )
    {
        this.dropType = dropType;
    }

    public String getTitle ()
    {
        return title;
    }

    public void setTitle ( String title )
    {
        this.title = title;
    }

    public String getSynonym ()
    {
        return synonym;
    }

    public void setSynonym ( String synonym )
    {
        this.synonym = synonym;
    }

    public String getCardSuffix ()
    {
        return cardSuffix;
    }

    public void setCardSuffix ( String cardSuffix )
    {
        this.cardSuffix = cardSuffix;
    }

    public String getDescription ()
    {
        return description;
    }

    public void setDescription ( String description )
    {
        this.description = description;
    }

    public String getMotrDescription ()
    {
        return motrDescription;
    }

    public void setMotrDescription ( String motrDescription )
    {
        this.motrDescription = motrDescription;
    }

    public String getIroDescription ()
    {
        return iroDescription;
    }

    public void setIroDescription ( String iroDescription )
    {
        this.iroDescription = iroDescription;
    }

    public String getRmsDescription ()
    {
        return rmsDescription;
    }

    public void setRmsDescription ( String rmsDescription )
    {
        this.rmsDescription = rmsDescription;
    }

    public String getScript ()
    {
        return script;
    }

    public void setScript ( String script )
    {
        this.script = script;
    }

    public Integer getSlotCount ()
    {
        return slotCount;
    }

    public void setSlotCount ( Integer slotCount )
    {
        this.slotCount = slotCount;
    }

    public Integer getBuyPrice ()
    {
        return buyPrice;
    }

    public void setBuyPrice ( Integer buyPrice )
    {
        this.buyPrice = buyPrice;
    }

    public Integer getSellPrice ()
    {
        return sellPrice;
    }

    public void setSellPrice ( Integer sellPrice )
    {
        this.sellPrice = sellPrice;
    }

    public Float getWeight ()
    {
        return weight;
    }

    public void setWeight ( Float weight )
    {
        this.weight = weight;
    }

    public Integer getAttack ()
    {
        return attack;
    }

    public void setAttack ( Integer attack )
    {
        this.attack = attack;
    }

    public Integer getDefense ()
    {
        return defense;
    }

    public void setDefense ( Integer defense )
    {
        this.defense = defense;
    }

    public Integer getRequiredLvl ()
    {
        return requiredLvl;
    }

    public void setRequiredLvl ( Integer requiredLvl )
    {
        this.requiredLvl = requiredLvl;
    }

    public Integer getWeaponLvl ()
    {
        return weaponLvl;
    }

    public void setWeaponLvl ( Integer weaponLvl )
    {
        this.weaponLvl = weaponLvl;
    }

    public Integer getRange ()
    {
        return range;
    }

    public void setRange ( Integer range )
    {
        this.range = range;
    }

    public List<MobDrop> getDropRates ()
    {
        return dropRates;
    }

    public void setDropRates ( List<MobDrop> dropRates )
    {
        this.dropRates = dropRates;
    }

    public String toString ()
    {
        return getText ();
    }

    /**
     * Дополнительные методы
     */

    public ImageIcon getSmallIcon ()
    {
        return RagUtils.getSmallItemIcon ( this );
    }

    public ImageIcon getIcon ()
    {
        return RagUtils.getItemIcon ( this );
    }

    public String getText ()
    {
        return RagUtils.getItemText ( this );
    }

    public String getMotrLink ()
    {
        return RagUtils.getMotrLink ( this );
    }

    public String getIroLink ()
    {
        return RagUtils.getIroLink ( this );
    }

    public String getRatemyserverLink ()
    {
        return RagUtils.getRatemyserverLink ( this );
    }
}